package codetop.microsoft.T24;

import util.ListNode;

/**
 * @Author: 18362
 * @Create: 2022-09-04 23:23:58 星期日
 */
class Solution {
    public ListNode swapPairs(ListNode head) {
        if (head == null || head.next == null)
            return head;
        ListNode p = head, q = head.next;
        ListNode tHead = swapPairs(q.next);
        p.next = tHead;
        q.next = p;
        return q;
    }
}